cmake_minimum_required(VERSION 3.8)
project(darts_adjust_node)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# 查找依赖包
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(image_transport REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(camera_info_manager REQUIRED)
find_package(OpenCV REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(std_msgs REQUIRED)

# 包含头文件目录
include_directories(
  include
  ${OpenCV_INCLUDE_DIRS}
)

# 添加可执行文件
add_executable(darts_adjust_node src/darts_adjust_node.cpp)

# 指定目标链接库
target_link_libraries(darts_adjust_node
  ${OpenCV_LIBRARIES}
)

# 指定目标依赖
ament_target_dependencies(darts_adjust_node
  rclcpp
  sensor_msgs
  image_transport
  cv_bridge
  camera_info_manager
  tf2_ros
  std_msgs  # 添加 std_msgs 依赖
)

# 安装可执行文件
install(TARGETS
  darts_adjust_node
  DESTINATION lib/${PROJECT_NAME}
)

# 安装头文件
install(DIRECTORY include/
  DESTINATION include/
)

ament_package()
